<div class="fm-content">
  <div class="title">
    <i nz-icon [type]="'desktop'"></i>
    &nbsp;&nbsp;考勤时间
  </div>
  <div class="work">
    <div class="top">
      <nz-date-picker nzPlaceHolder="开始时间" class="fm-input first-input" [(ngModel)]="fs.queryObject['yxkssj:>']">
      </nz-date-picker>
      <nz-date-picker nzPlaceHolder="结束时间" class="fm-input" [(ngModel)]="fs.queryObject['yxjssj:<']">
      </nz-date-picker>
      <nz-button-group class="fm-search-input">
        <button nz-button nzType="primary" (click)="fs.loadData(true)">查询</button>
        <button nz-button (click)="fs.resetQueryObject() && fs.loadData(true)">重置</button>
      </nz-button-group>
      <div class="tool-right">
        <nz-button-group>
          <button nz-button [nzType]="'primary'" (click)="fs.addRow()">新增</button>
          <button nz-button (click)="fs.editRow()">编辑</button>
          <button nz-popconfirm nzTitle="确认删除选择项?" (nzOnConfirm)="fs.delEntitys()" nzPlacement="bottomRight"
            nz-button>删除</button>
        </nz-button-group>
      </div>
    </div>

    <div class="work-content">
      <div class="table">
        <nz-table nzSize="middle" nzShowSizeChanger class="fm-table-font"
          [nzPageSizeOptions]='[ 10, 15, 20, 30, 40, 50 ]' [nzFrontPagination]="false" [nzData]="fs.datas"
          [nzLoading]="fs.isLoading || fs.isDeleing" [nzTotal]="fs.rowsCount" [(nzPageIndex)]="fs.pageIndex"
          [(nzPageSize)]="fs.pageSize" (nzPageIndexChange)="fs.loadData()" (nzPageSizeChange)="fs.loadData(true)">
          <thead (nzSortChange)="fs.sort($event)" nzSingleSort>
            <tr>
              <th nzShowCheckbox [(nzChecked)]="fs.allChecked" [nzIndeterminate]="fs.indeterminate"
                (nzCheckedChange)="fs.checkAll($event)">
              </th>
              <th><span>时间</span></th>
              <th><span>上午上班时间</span></th>
              <th><span>上午下班时间</span></th>
              <th><span>下午上班时间</span></th>
              <th><span>下午下班时间</span></th>
              <th><span>操作</span></th>
            </tr>
          </thead>
          <tbody>
            <tr *ngFor="let data of fs.datas">
              <td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="fs.refreshCheckStatus()">
              </td>
              <td><span (click)="fs.editRow(data)" class="form-edit">
                  {{data.yxkssj | date:'yyyy年MM月dd日' }}至{{data.yxjssj | date:'yyyy年MM月dd日' }}</span></td>
              <td>
                {{data.swsbkssj | date:'HH:mm' }}至{{data.swsbjssj | date:'HH:mm' }}</td>
              <td>
                {{data.swxbkssj | date:'HH:mm' }}至{{data.swxbjssj | date:'HH:mm' }}</td>
              <td>
                {{data.xwsbkssj | date:'HH:mm' }}至{{data.xwsbjssj | date:'HH:mm' }}</td>
              <td>
                {{data.xwxbkssj | date:'HH:mm' }}至{{data.xwxbjssj | date:'HH:mm' }}</td>
              <td>
                <a nz-popconfirm nzTitle="确认删除该项?" (nzOnConfirm)="fs.fdelEntity(data)" nzPlacement="bottomRight"
                  class="form-button">删除</a>
              </td>
            </tr>
          </tbody>
        </nz-table>
      </div>
    </div>

    <nz-modal nzWidth='830' nzTitle="编辑" [nzMaskClosable]='false' [nzFooter]="null" [(nzVisible)]="fs.isEditVisible"
      (nzOnCancel)="fs.closeEdit()">
      <form nz-form [nzLayout]="'inline'">
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">开始时间</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="yxkssj.invalid?'error':'success'" nzHasFeedback>
                <nz-date-picker [(ngModel)]="fs.er.yxkssj" name="yxkssj" required #yxkssj="ngModel">
                </nz-date-picker>
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">结束时间</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="yxjssj.invalid?'error':'success'" nzHasFeedback>
                <nz-date-picker [(ngModel)]="fs.er.yxjssj" name="yxjssj" required #yxjssj="ngModel">
                </nz-date-picker>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">上午上班开始</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="swsbkssj.invalid?'error':'success'"
                nzHasFeedback>
                <nz-time-picker [(ngModel)]="fs.er.swsbkssj" nzFormat="HH:mm" name="swsbkssj" required
                  #swsbkssj="ngModel"></nz-time-picker>
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">上午上班结束</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="swsbjssj.invalid?'error':'success'"
                nzHasFeedback>
                <nz-time-picker [(ngModel)]="fs.er.swsbjssj" nzFormat="HH:mm" name="swsbjssj" required
                  #swsbjssj="ngModel"></nz-time-picker>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">上午下班开始</nz-form-label>
              <nz-form-control class="form-control" nzHasFeedback>
                <nz-time-picker [(ngModel)]="fs.er.swxbkssj" nzFormat="HH:mm" name="swxbkssj" #swxbkssj="ngModel">
                </nz-time-picker>
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">上午下班结束</nz-form-label>
              <nz-form-control class="form-control" nzHasFeedback>
                <nz-time-picker [(ngModel)]="fs.er.swxbjssj" nzFormat="HH:mm" name="swxbjssj" #swxbjssj="ngModel">
                </nz-time-picker>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">下午上班开始</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="xwsbkssj.invalid?'error':'success'"
                nzHasFeedback>
                <nz-time-picker [(ngModel)]="fs.er.xwsbkssj" nzFormat="HH:mm" name="xwsbkssj" required
                  #xwsbkssj="ngModel"></nz-time-picker>
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">下午上班结束</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="xwsbjssj.invalid?'error':'success'"
                nzHasFeedback>
                <nz-time-picker [(ngModel)]="fs.er.xwsbjssj" nzFormat="HH:mm" name="xwsbjssj" required
                  #xwsbjssj="ngModel"></nz-time-picker>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">下午下班开始</nz-form-label>
              <nz-form-control class="form-control" nzHasFeedback>
                <nz-time-picker [(ngModel)]="fs.er.xwxbkssj" nzFormat="HH:mm" name="xwxbkssj" #xwxbkssj="ngModel">
                </nz-time-picker>
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">下午下班结束</nz-form-label>
              <nz-form-control class="form-control" nzHasFeedback>
                <nz-time-picker [(ngModel)]="fs.er.xwxbjssj" nzFormat="HH:mm" name="xwxbjssj" #xwxbjssj="ngModel">
                </nz-time-picker>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="24">
            <nz-form-item>
              <nz-form-label class="form-label">备注</nz-form-label>
              <nz-form-control class="form-control3">
                <textarea nz-input [(ngModel)]="fs.er.bz" name="bz"></textarea>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24" *ngIf="!fs.er.FIELD_ISNEW">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">创建人</nz-form-label>
              <nz-form-control class="form-control">
                {{fs.er.cjrmc}}
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">创建时间</nz-form-label>
              <nz-form-control class="form-control">
                {{fs.er.cjsj | date:'yyyy年MM月dd日 HH:mm:ss'}}
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="24" class="form-button-align">
            <button nz-button nzType="default" (click)="fs.closeEdit()" class="form-button">取消</button>
            <button nz-button nzType="primary"
              [disabled]='yxkssj.invalid || yxjssj.invalid || swsbkssj.invalid || swsbjssj.invalid || xwxbkssj.invalid || xwxbjssj.invalid'
              (click)="fs.save()" [nzLoading]="fs.isSaveing">保存</button>
          </div>
        </div>
      </form>
    </nz-modal>
  </div>
</div>